Skip to content

Embed G7SensorKit in the watch app again - #2653

Closed
dabear wants to merge 1 commit into
LoopKit:next-devfrom
bjorninge-no-personal:fix/watch-g7sensorkit
Closed

dabear wants to merge 1 commit into
LoopKit:next-devfrom
bjorninge-no-personal:fix/watch-g7sensorkit

Conversation

@dabear

@dabear dabear commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

The watch app imports G7SensorKit (WatchApp Extension/Managers/WatchDeviceManagers.swift, from d815b6d "Read a G7 directly on the watch"), but since #2645 the WatchApp target no longer links or embeds it.

What happens on next-dev

  • A clean build (empty DerivedData) fails in the WatchApp target:
    WatchDeviceManagers.swift:12:8: error: Unable to resolve module dependency: 'G7SensorKit' (in target 'WatchApp' from project 'Loop')
    
    A build into an older DerivedData that still has a watchOS G7SensorKit.framework succeeds, so this is easy to miss.
  • If G7SensorKit for watchOS is built first by hand, the watch app links @rpath/G7SensorKit.framework/G7SensorKit (Swift auto-linking from the import), but Watch/WatchApp.app/Frameworks has only LoopKit and LoopCore. On a watch it would fail to load that library at launch.

Cause

d815b6d added three objects to Loop.xcodeproj/project.pbxproj for the WatchApp target:

  • the file reference F8760AF3… (G7SensorKit.framework, built products)
  • the build file 921B7FAE… (link)
  • the build file 101AA737… (Embed Frameworks)

4d700ab (#2645) removed all three, and their entries in the WatchApp's Embed Frameworks phase and the Frameworks group. It left 921B7FAE… /* G7SensorKit.framework in Frameworks */ in the WatchApp's Frameworks build phase, pointing at an object that no longer exists; Xcode ignores it.

Fix

Restore the three objects as d815b6d had them, with the Embed Frameworks and group entries (+5 lines, project.pbxproj only).

Verified

  • plutil -lint passes.
  • A fresh clone of LoopWorkspace next-dev (1321af1), with Loop at this branch (next-dev f7b08ca plus this commit), builds the LoopWorkspace scheme for the iOS Simulator from empty DerivedData: BUILD SUCCEEDED.
  • The built watch app's Frameworks now has G7SensorKit.framework, LoopKit.framework and LoopCore.framework.
  • Not run on a physical watch.

(Unrelated, left as is: next-dev also defines the build file 8B5CF014… /* LoopKit.framework in Frameworks */ twice, identically. Xcode tolerates it.)

d815b6d (Read a G7 directly on the watch) linked and embedded G7SensorKit in
the WatchApp target for WatchDeviceManagers.swift, which imports it. LoopKit#2645
removed the framework's file reference and both build files, but left the
reference in the WatchApp's Frameworks build phase, which then pointed at
nothing. A clean build failed to resolve G7SensorKit for the WatchApp, and a
build that found it in old DerivedData linked it without embedding it.

This restores the three objects as d815b6d had them.
@dabear

dabear commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

@dabear

dabear commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Duplicate of #2652, which restores the same G7SensorKit entries and also drops the three dangling OmnipodKit/RileyLink references. Verified the same G7SensorKit change: a fresh LoopWorkspace next-dev clone with Loop at next-dev + this fix builds from empty DerivedData, and the watch app embeds G7SensorKit.framework.

@dabear dabear closed this Nov 3, 2026
@dabear
dabear deleted the fix/watch-g7sensorkit branch November 3, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant